<?php
namespace backend\controllers;


use backend\component\BackendBaseController;
use backend\component\ResultFormat;
use backend\service\PhotoService;

class PhotoController extends BackendBaseController
{
    public function actions()
    {
        return [
            'error' => [
                'class' => 'frontend\actions\DefaultErrorAction'
            ]
        ];

    }
    public function actionDelete(){
        $ids =  \Yii::$app->request->get("id",0);
        $ids = explode(",",$ids);
       $result =  PhotoService::removePhotos($ids);
       return $result;
    }
    public function actionEdit(){
        $get =   $get = \Yii::$app->request->get();
        $result = PhotoService::getPhotoById($get);
        return $result;
    }
    public function actionModify(){
        $get =   $get = \Yii::$app->request->get();
        $params = \Yii::$app->request->post("form");
       return  PhotoService::modifyPhoto($get,$params);
    }
    public function actionSet(){
        $get =   $get = \Yii::$app->request->get();
        return  PhotoService::setPhoto($get);
    }
    public function actionMove(){
        $get =   $get = \Yii::$app->request->get();
        return  PhotoService::movePhoto($get);
    }
}